<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="Stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.3.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<h1>个人主页</h1>
		<div class="row"
			style="margin:50px 0px; border: 1px solid #e6e6e6; padding: 0 20px;">
			<p style="margin-top: 20px;">
				<a href="house-edit">发表新房屋信息</a>
			</p>
			<table class="table table-striped">
				<tr>
					<th>标题</th>
					<th>价格</th>
					<th>楼层</th>
					<th>更新时间</th>
					<th>状态</th>
					<th>操作</th>
					<th>删除</th>
				</tr>
				<c:forEach items="${houses}" var="house">
					<tr>
						<td>${house.topic}</td>
						<td>￥<fmt:formatNumber pattern="#.00" value="${house.price}"></fmt:formatNumber></td>
						<td>${house.floor}</td>
						<td><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${house.updateTime}"/> </td>
						<td>
							<c:if test="${house.state==1}">上架中</c:if>
							<c:if test="${house.state==0}">下架</c:if>
						</td>
						<td><a href="house-edit?id=${house.id}">编辑</a></td>
						<td><a href="javascript:;">删除</a></td>
					</tr>
				</c:forEach>
			</table>
			<nav aria-label="Page navigation" style="margin-left:50%;">
				<ul class="pagination">
					<c:if test="${page>1}">
						<li><a href="list?page=${page-1}" aria-label="Previous"> <span
							aria-hidden="true">&laquo;</span>
						</a></li>
					</c:if>
					<c:forEach begin="1" end="${totalPage}" var="h">
						<li><a href="list?page=${h}">${h}</a></li>
					</c:forEach>
					<c:if test="${page<totalPage}">
						<li><a href="list?page=${page+1}" aria-label="Next"> <span
							aria-hidden="true">&raquo;</span>
						</a></li>
					</c:if>
				</ul>
			</nav>
			<span style="margin-left:50%;">第${page}页/共${totalPage}页</span>
		</div>
	</div>
</body>
</html>